/**
 * @program: pettyloan
 * @ClassName OverDueRepay
 * @author: 汪江
 * @create: 2022-12-12 10:13
 **/
package com.wn.pettyloan.util;


import com.wn.pettyloan.util.utilentity.OverDue;
import com.wn.pettyloan.util.utilentity.RePay;

import java.math.BigDecimal;

public class OverDueRepay {
    public static RePay overDueMethod(OverDue overDue) {
        RePay rePay = new RePay();
        rePay.setPrincipal(overDue.getTotalOverdueMoney());
        rePay.setInterest((overDue.getSurplusPrincipal()+overDue.getTotalOverdueMoney())*(overDue.getOverDueInterest()/365)*overDue.getOverDueDate());
        rePay.setTotal(rePay.getPrincipal() + rePay.getInterest());
        return rePay;
    }
}
